All Questions
29 questions
3votes
1answer
362views
High performance 3 Way Quick Sort Implementation
My implementation of 3 way quick sort for strings. It supposed to sort very large set of 800,000,000 objects. This is why I added ...
2votes
2answers
162views
Function to find substring in a list of strings and add them to the resulting list
I am trying to look for a substring in a list of strings. My end result is an array that contains the presence of substring first based on course.name and then ...
1vote
2answers
330views
Sorting string with if-else
I was asked to write a program that sorts three strings alphabetically using only if-else (no sorting algorithms, usage of arrays whatsover). I'm fairly new to C++ programming but I've come up with ...
1vote
1answer
249views
Bubble sort in C (for strings)
What do you think of this bubble sorting function in C, for a string array? I would like to improve the readability, performance, and any good practices. ...
2votes
1answer
200views
Sort an array of strings using bubble sort
I have this following code to sort an array of strings order by ASCII value (alphabetically) using bubble sort. ...
5votes
2answers
618views
Computing word-frequency-table
I got a word count assignment and the requirements are shown below: INPUT The input contains words in several lines and in each line there could be more than one word. The input only contains ...
4votes
5answers
2kviews
Sort string's characters into alphabetic order
Any improvements that I can make with this code? Also, is there another way to convert a vector to a string variable without using a for ranged-based loop? From the posts I've seen for converting, I ...
12votes
3answers
9kviews
Return characters in a string in alphabetical order
Problem Take a string and return all input characters in alphabetical order Assume that no numbers or punctuation will be used For the same character, uppercase characters should be returned ...
3votes
1answer
11kviews
Sorting an array of strings in C using insertion sort
I am a Java programmer who has C this semester. Needless to say, my writing style is heavily influenced by Java, which is probably not a great thing. I'd be grateful for a few nudges in the right ...
3votes
1answer
230views
Sorting a long string with a composite of strings and integers + symbols
The code below is to sort a file containing the following info (eg. input.txt): ...
12votes
3answers
6kviews
Natural Order Comparator
I've been looking for an implementation of Comparator that provides a "natural order". I found a couple but they were buggy or poorly designed. I wrote my own with ...
1vote
1answer
2kviews
Sorting array of strings in c
Is there a simpler way with a simpler notation to do the following part of code: ...
8votes
3answers
3kviews
Word-counting script in C#
My goal is to read from standard input, break up the input into words (Unicode letters and apostrophes), case-insensitively, and produce a report to standard output, where each line is a word followed ...
2votes
2answers
114views
Implementing a Sort for an Array
Yesterday, I gave an interview after a long time, and I was asked a question which I couldn't solve on the spot. I had to implement a sort function for a Array of strings in JavaScript, with the ...
2votes
1answer
9kviews
Sorting the array of strings on their lengths in Java , Using Maps, ascending order....
I wrote the java method to answer this question : Write a Program to sort String on their length in Java? Your method should accept an array of String and return a sorted array based upon the length ...